#pragma once
#include "wlroots.hpp"
#include "utils.h"
#include "server.h"

#include <sigc++/sigc++.h>

#include <list>
#include <array>

class KeyboardWrapper
{
public:
    KeyboardWrapper(struct wlr_input_device *device, Server* server);
    ~KeyboardWrapper();

    inline struct wlr_keyboard* keyboard() { return m_wlr_keyboard; }

    sigc::signal<void(struct wlr_keyboard*)> sig_modifiers;
    sigc::signal<void(struct wlr_keyboard*, struct wlr_keyboard_key_event*)> sig_key;
    sigc::signal<void()> sig_destroy;

private:
    void handle_modifiers();
    void handle_key(struct wlr_keyboard_key_event *event);
    void handle_destroy();

private:
    Server *m_server;

    struct wlr_keyboard *m_wlr_keyboard;
    wl_listener_wrapper m_modifiers;
    wl_listener_wrapper m_key;
    wl_listener_wrapper m_destroy;
};
